1. Field of the Invention
The present invention relates to an image processing apparatus configured to generate a vector sequence representing a color image, a method for controlling the image processing apparatus, and a storage medium storing a related control program.
2. Description of the Related Art
The vector processing technique is conventionally used to process an image, such as fonts for a word processor. The font processing technique includes inputting a sophisticated character design as an object of the vector processing. For example, a conventional technique can digitize an analog character design into a binary image of a relatively large size equivalent to 512×512 or 1024×1024 pixels and generate a vector sequence representing a contour of the character. In general, vector data can realize a smooth contour expression of a character in various sizes and can keep good shape of the character. Furthermore, various sizes of characters can be simply generated from the same vector data without requiring a large amount of data.
Therefore, as discussed in U.S. Pat. No. 5,878,161 (corresponding to Japanese Patent Application Laid-Open No. 5-174140), the vector processing can be applied not only to fonts but also other binary images.
The vector data is numerical data, such as coordinate values, which can be easily edited by a computer. For example, as discussed in U.S. Patent Publication No. 2007/0230809 A1, it is useful to apply vector processing to the line art (line image). As discussed in Japanese Patent Application Laid-Open No. 7-121699, vector processing can be applied to a full-color image. U.S. Pat. No. 6,404,921 (corresponding to Japanese Patent Application Laid-Open No. 4-157578) discusses vector processing applied to a binary image.
The method discussed in U.S. Pat. No. 6,404,921 includes a step of designating predetermined position as a point constituting a contour line based on the state of a target pixel and its neighboring pixels, and a step of determining a connecting direction of points constituting the contour line based on the state of neighboring pixels. Furthermore, the method includes steps of determining a connection state between one and other points constituting the contour line, updating the position of the target pixel on image data in a raster scanning order, and executing the above-described processing based on the state of neighboring pixels for each target pixel, to extract contour points.
The method further includes steps of extracting a target pixel in a raster scanning order while maintaining the state of the target pixel and its neighboring pixels on the image data, detecting inter-pixel vectors in the horizontal direction and the vertical direction based on the state of the target pixel and its neighboring pixels, determining a connection state of these inter-pixel vectors, and extracting a contour of image data based on the determined connection state of the inter-pixel vectors.
The method discussed in U.S. Pat. No. 6,404,921 can extract all contour lines involved in an image upon finishing a single complete operation of raster scanning. An image memory is not required to store all image data. Thus, a small image memory can be used. This method is characterized in that a contour line is extracted in the units of the periphery of a pixel, not the central position of a pixel, of an input image. Thus, the method is effective for a thin line having a one-pixel width.
As discussed in U.S. Patent Application Publication No. US 2005/0238244 A1 (corresponding to Japanese Patent Application Laid-Open No. 2005-346137), it is useful to express contour information of a binary image using the 2-order or 3-order Bezier curve approximation in addition to straight lines. A processing method and a processing apparatus using the function approximation of the contour information can reduce the amount of data expressing a high quality variable power image.
Furthermore, it is useful to extract outline vectors from a binary image according to the method discussed in U.S. Pat. No. 6,404,921 and applying function approximation discussed in U.S. Pat. No. 5,878,161 to the extracted outline vectors. The obtained smoothed outline vectors can form a high-quality digital binary image of a desired (arbitrary) magnification.
However, the conventional color image vector processing relies on the steps of determining a region of pixels having the same color attribute determined on the color space of an input image (i.e., a same color region composed of same color pixels) and generating a vector sequence constituting a contour shape of each determined same color region.
However, if the contour of each region is subjected to Bezier function approximation or smoothing processing, a clearance or an overlap may appear along the boundary of regions because the contours of neighboring regions on the input image may not be subjected to the same approximation or smoothing processing. FIG. 57 illustrates an example of contour shapes extracted for an input image, according to which serially joined pixels having the same color defined on the color space constitute the same region. There are three color regions adjacent to each other on the input image, if the background color is neglected.
FIG. 58 illustrates a clearance and an overlap between two regions which have been generated by the smoothing (function approximation) processing applied to the vectors constituting a contour shape of each region.